import request from '@/utils/request'




// 查询负面舆情
export function negativeInformationHeatMap(query) {
  return request({
    url: '/system/events/negativeInformationHeatMap',
    method: 'get',
    params: query,
  })
}


// 信息总览
export function getAllInformation(query) {
  return request({
    url: '/system/events/getAllInformation',
    method: 'get',
    params: query
  })
}

// 事件关联人物
export function getPersonsByEventId(query) {
  return request({
    url: '/system/events/getPersonsByEventId',
    method: 'get',
    params: query
  })
}


// 事件关联区域
export function getLocationsByEventId(query) {
  return request({
    url: '/system/events/getLocationsByEventId',
    method: 'get',
    params: query
  })
}


// 事件关联机构
export function getOrganizationsByEventId(query) {
  return request({
    url: '/system/events/getOrganizationsByEventId',
    method: 'get',
    params: query
  })
}

// 事件演化趋势分析
export function getPublicOpinionCountGroupByDayOfEventId(query) {
  return request({
    url: '/system/events/getPublicOpinionCountGroupByDayOfEventId',
    method: 'get',
    params: query
  })
}



// 舆情数量按省分组
export function getPublicOpinionCountGroupByProvinceOfEventId(query) {
  return request({
    url: '/system/events/getPublicOpinionCountGroupByProvinceOfEventId',
    method: 'get',
    params: query
  })
}



// 观点分析
export function getViewpointAnalysis(query) {
  return request({
    url: '/system/events/getViewpointAnalysis',
    method: 'get',
    params: query
  })
}

// 获取事件热词
export function getKeywordsByEventId(query) {
  return request({
    url: '/system/events/getKeywordsByEventId',
    method: 'get',
    params: query
  })
}


// 媒体活跃排行榜（情感）
export function countSensitiveOpinionByMediaName(query) {
  return request({
    url: '/system/events/countSensitiveOpinionByMediaName',
    method: 'get',
    params: query
  })
}
// 意见领袖排行（情感）
export function countSensitiveAuthorOpinion(query) {
  return request({
    url: '/system/events/countSensitiveAuthorOpinion',
    method: 'get',
    params: query
  })
}

// 情感载体分析
export function getMediaTypeSensitiveDayNumEvent(query) {
  return request({
    url: '/system/events/getMediaTypeSensitiveDayNumEvent',
    method: 'get',
    params: query
  })
}

// 首发媒体溯源
export function getFirstMediaReleasedByEventId(query) {
  return request({
    url: '/system/events/getFirstMediaReleasedByEventId',
    method: 'get',
    params: query
  })
}


// 信息载体趋势图
export function getMediaTypeByPublishTimeByEventId(query) {
  return request({
    url: '/system/events/getMediaTypeByPublishTimeByEventId',
    method: 'get',
    params: query
  })
}


// 获取正负面信息趋势图
export function getSentimentByPublishTimeByEventId(query) {
  return request({
    url: '/system/events/getSentimentByPublishTimeByEventId',
    method: 'get',
    params: query
  })
}

//查询事件关联的舆情
export function queryByEventParameter(data,pageParams) {
  return request({
    url: `/system/opinion/queryByEventParameter/${ data.eventId }`,
    method: 'post',
    data: data,
    params: pageParams
  })
}



// 查询事件列表
export function listEventsAll(query) {
  return request({
    url: '/system/events/listAll',
    method: 'get',
    params: query
  })
}

// 查询事件详细
export function getEvents(eventId) {
  return request({
    url: '/system/events/' + eventId,
    method: 'get'
  })
}

// 查询事件意识形态
export function getIdeologyEvent(eventId) {
  return request({
    url: '/system/events/getIdeologyEvent/' + eventId,
    method: 'get'
  })
}



// 生成报告
export function generateReportByEventId(eventId) {
  return request({
    url: '/system/events/generateReportByEventId/' + eventId,
    method: 'get'
  })
}


// 新增事件
export function addEvents(data) {
  return request({
    url: '/system/events',
    method: 'post',
    data: data
  })
}

// 修改事件
export function updateEvents(data) {
  return request({
    url: '/system/events',
    method: 'put',
    data: data
  })
}

// 删除事件
export function delEvents(eventId) {
  return request({
    url: '/system/events/' + eventId,
    method: 'delete'
  })
}

// 导出事件
export function exportEvents(query) {
  return request({
    url: '/system/events/export',
    method: 'get',
    params: query
  })
}


//
export function getMediaType(data) {
  return request({
    url: `/system/opinion/queryMediaTypeByEventId/${ data.eventId }`,
    method: 'post',
    data: data
  })
}

//
export function updateSensitiveInformation(query) {
  return request({
    url: `/system/opinion/update/sensitiveInformation/` + query.ids,
    method: 'get',
    params: query
  })
}

//加入预警
export function joinTheForecast(query) {
  return request({
    url: `/system/opinion/joinTheForecast/` + query.ids,
    method: 'get',
    params: query
  })
}

//设置舆情事件关联关系
export function unbindOpinionForEvent(query) {
  return request({
    url: `/system/events/setRelationBatch/` + query.ids,
    method: 'get',
    params: query
  })
}


//热点事件列表
export function hotEvents(query) {
  return request({
    url: `/system/events/hotEvents/`,
    method: 'get',
    params: query
  })
}



// 關聯分析
export function associationAnalysis(query) {
  return request({
    url: `/system/events/associationAnalysis/` + query.eventIds,
    method: 'get',
    params: query,
  })
}





// 取摘要
export function getSummary(query) {
  return request({
    url: `/system/events/getSummary/`+query.eventIds,
    method: 'get',
    params: query,
  })
}



//将事件相关统计图传给后台
export function postImages(data) {
  return request({
    url: `/system/events/persist`,
    method: 'post',
    data: data,
  })
}




